let dns = require('dns');

var domains = ["hk1.v2u9.top", "hk2.v2u9.top", "hk3.v2u9.top", "hk4.v2u9.top", "hk5.v2u9.top", "hk6.v2u9.top", "hk7.v2u9.top", "hk8.v2u9.top", "hk9.v2u9.top", "hk0.v2u9.top", "hk11.v2u9.top", "hk12.v2u9.top", "hk13.v2u9.top", "hk14.v2u9.top", "hk15.v2u9.top"];

getIp();

function getIp(){
    let ips = domains.map((item)=>{
        var ip;
        dns.resolve(item, callback=(err, result) => {

            if (err) {
                console.error(`error: ${err}`)
            } else {
                console.log(result)
                ip=result;
            }
        })
        return ip;
    });
    console.log(ips)

}
